Method and apparatus for automatically generating and incorporating code in development environments

ABSTRACT

A method and apparatus for automatically generating and incorporating code in a development environment (DE) is provided. The method comprises, while a program for a target device is being composed using the DE on a user device, displaying an automatic code generation user interface (ACGUI), separate from the DE or in the context of the DE, receiving a selection of a function from a plurality of available functions for generating code automatically corresponding to the selected function, receiving at least one parameter for executing the automatically generated code to perform the function, automatically generating the code in the ACGUI, the automatically generated code configured to perform the function upon execution of the automatically generated code, incorporating the automatically generated code in the program for the target device, and sending the program to the target device for installation and execution on the target device.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of the U.S. Provisional Application No. 62/471,071, having the same title and filed on Mar. 14, 2017, the contents of which are hereby incorporated by reference in its entirety.

BACKGROUND Field

Embodiments described herein generally relate to a method and apparatus for automatically generating and incorporating code in development environments.

Description of the Related Art

While composing a program (or “programming”) in a development environment (DE), programmers add one or more functionalities to a program. The users may code such functionalities themselves using the DE. However, coding functionalities for a wide variety of target devices for which the program is being created in the DE can be challenging for an average user who is not an expert in programming. Different target devices may have different system requirements for supporting implementation of a function. Even a user expert in one programming language, or in programming for one type of target device may find it challenging to create fully functional and optimized programs in a variety of programming languages, and/or for a variety of target devices.

Further, programming for target devices such as field programmable gate arrays (FPGAs) and other controller-based devices (e.g. microcontroller or microprocessor based devices), for example memory controller unit (MCU) and system on a chip (SoC) is even more complex, given the wide variety of device types, varied system requirements, configurations, applications, and programming languages used. To add to the complexity, such devices are deployed in remote locations, and usually adjunct to conventional systems, making programming for such target devices for adding functionalities very challenging for an average user.

Thus, there is a need in the art for simplifying programming in development environments, while automatically generating code for being incorporated in programs generated in such development environments.

SUMMARY

Embodiments described herein generally relate to a method and apparatus for automatically generating and incorporating code in development environments, substantially as shown in and/or described in connection with at least one of the figures, as set forth more completely in the claims.

These and other features and advantages of the present disclosure may be appreciated from a review of the following detailed description of the present disclosure, along with the accompanying figures in which like reference numerals refer to like parts throughout.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above-recited features of the embodiments described herein can be understood in detail, a more particular description of the embodiments, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments and are therefore not to be considered limiting of its scope.

FIG. 1 is block diagram of a system for automatically generating and incorporating code in development environments, in accordance with an embodiment;

FIG. 2 is a flow diagram of a method for automatically generating and incorporating code in development environments as executed by one or more devices of the system of FIG. 1, in accordance with an embodiment;

FIGS. 3-5 depict graphical user interface (GUI) screens associated with automatically generating and incorporating code in development environments, according to the flow diagram of FIG. 2, in accordance with an embodiment;

FIG. 6 is a flow diagram of a method for automatically generating and incorporating code in development environments as executed by one or more devices of the system of FIG. 1, in accordance with an embodiment;

FIGS. 7-12 depict GUI screens illustrating implementation of a method for automatically generating and incorporating code in development environments, according to the flow diagram of FIG. 6, in accordance with an embodiment;

FIG. 13 is a GUI screen for receiving inputs for generating a simple code for posting a message on TWITTER, in accordance with an embodiment; and

FIG. 14 is a flow diagram of a method for illustrating execution of an automatically generated program executed by a target device of the system of FIG. 1, in accordance with an embodiment.

DETAILED DESCRIPTION

Embodiments described herein relate to method and apparatus for automatically generating and incorporating code in development environments, and more specifically to enabling automatic creation of code corresponding to a desired functionality, while a user is creating or composing a program for a target device in a development environment (DE), and to incorporating or injecting, manually or automatically, the automatically generated code in the program. The DE can be on a device remote to the target device, and for example, a web-based DE accessible via a browser. While programming or creating the program using the DE on the user device, the user accesses an automatic code generation user interface (ACGUI) on the user device. The ACGUI is available either in the context of the DE or as a separate interface from the DE. The ACGUI presents a library of available functionalities for which automatic generation of code is available. The ACGUI may be populated by a coding and virtualization server (CVS) remote to the user device, a process library stored on the user device, a process library stored local to the user device, or a process library stored on a server which hosts the DE on the user device, where the DE server may be local or remote to the user device.

The user selects a desired function in the ACGUI, specifies parameters and provides other inputs as may be required for the automatic generation of code for the desired function. Based on the provided inputs, the CVS automatically generates code corresponding to the desired function. The automatically generated code is then injected or otherwise incorporated, manually or automatically, into the program being created by the user on the DE. As used herein, the terms “inject” or “incorporate” are used interchangeably in the context of code being injected or incorporated in a program being developed for an application in a DE, and refer to appropriately importing the code into the program, such that the program including the automatically generated code may be executed without additional modifications. For example, the CVS and the DE are configured for the CVS to send the automatically generated code to the DE, in a manner configured by the user, or the automatically generated code generated is generated in the context of DE, and imported into a program being created in the DE based on user instructions from within the DE, or pre-defined instructions. The program comprising the automatically generated code, also referred to as automatically generated program (AGP) is then sent to the target device for installation and execution. In some embodiments, the functionality to generate code automatically, for example, code and software development kit (SDK) generator, is included in the DE on the user device, a device local to the DE, or the DE server remote to the DE. In some embodiments, the automatically generated code comprises a call from the target device to the CVS for executing a program on the CVS, referred to as the CVS program (CVSP), execution of which on the CVS performs the desired function. By executing the CVSP on the CVS, the call incorporated in the automatically generated code imparts additional functionality to the AGP. In some embodiments, the CVSP may further initiate a remote service executed by remote servers based on the call. In some embodiments, the call included in the automatically generated code is made from the target device directly to a device capable of performing the remote service, which also imparts additional functionality to the AGP.

Parameters and other inputs are also specified along with the desired function, and include information for operation of the automatically generated code on the target device such as target device type, power requirements, network equipment configuration, network details, authentication details for additional services or devices if required for execution of the desired function, among several other parameters and inputs as will be readily appreciated by persons skilled in the art. Parameters may also include information for operation of the call, for example, routing the call appropriately to the CVS or to a remote service. Parameters may also include information required for executing the CVSP or the remote service.

Commonly assigned U.S. Pat. No. 8,726,285, filed 28 Jan. 2011; U.S. Pat. No. 9,436,439, filed 17 Jun. 2014; U.S. Pat. No. 9,239,705, filed 17 Jun. 2014; U.S. Pat. No. 9,235,383, filed 17 Jun. 2014; and U.S. Patent Application Publication Numbers 2009/0070121, filed 11 Sep. 2007; 2009/0070162, filed 11 Sep. 2007; 2015/0199088, filed 9 Jan. 2015; 2015/0286362, filed 13 Apr. 2015; 2016/0327925, filed 8 Mar. 2016; 2016/0328216, filed 6 May 2016; U.S. application Ser. No. 15/163,280, filed May 24, 2016; and Ser. No. 15/386,180, filed Dec. 21, 2016, each of which is incorporated herein by reference in their entireties, describe techniques for developing software for a device incorporating a controller, and executing, managing, reprogramming or changing the behavior of the software, e.g. remotely, to extend the capabilities of such a device via defined workflows.

These techniques function by generating, automatically, an entire program code or a code snippet in a desired programming language, for a desired platform, to enable the capability of performing a desired functional. If a code snippet is generated, it is incorporated or injected into a complete program, as desired. In some embodiments, the snippet or the entire program, when executed on a target device for which the program is generated, additionally places a call for one or more processes to be executed on a remote device, e.g., the CVS, and/or sends (directly or via the code virtualization server) data to a remote service provider, and/or further calls a function to be remotely performed on the data by the remote service provider. Embodiments described herein use these techniques to automatically generate code corresponding to a desired functionality, and inject such code in a program for a target device, where the program is created using a DE on a user device. With such embodiments, functionalities can be added conveniently while creating the program in a familiar DE. For example, in some embodiments, the functionalities may be added by accessing an ACGUI on the user device, where the ACGUI is separate from the DE. In some embodiments, the ACGUI is available in the context of the DE, thereby enabling a user to add functionalities without leaving the DE, greatly enhancing the ease with which functionalities may be programmed for target devices. Functionalities added in this manner, that is, via programs on devices remote to the target device and executed based on a call from the remote device, enhances the capabilities of the target device. For example, the target device may be incapable of performing such functionalities itself due to lack of processing resources, otherwise restricted in performing the functionality(ies), or in order to keep the functionalities updated by updating such programs on remote devices, without having to update the code on the target devices.

In some embodiments, the AGP, when executed on the target device, places calls to a remote device, for example the CVS, for executing the CVSP. In some embodiments, such calls from the controller device are made for interacting with one or more remote services, such as FACEBOOK, TWITTER, AMAZON, data storage service, and the like, that are not provided by the CVS. The remote calls can be implemented as a call directly from the target device to the remote services, or as a call to a program on the CVS (CVSP), which in turn interacts with the remote services and provides the data to the target device for further execution of the AGP.

Embodiments described herein are thus capable of automatically generating and injecting code in development environments (DE), enabling a user or programmer to do from the same user device on which the DE is hosted. Non-limiting examples of DEs include Integrated Development Environments (IDE) such as ECLIPSE.ORG, MICROSOFT VISUAL STUDIO and the like for generating programs, 3D Modeling editors and tools such as AUTODESK, CINEMA 4D, ZBRUSH for designing objects and devices, and thereafter program such object or devices according to the embodiments described herein.

FIG. 1 is an overview diagram of a system 100 for automatically generating and injecting code in development environments, for example, for being injected in programs created for target device system 152, which may comprise one or more target devices (154, 156, . . . 158), and for example the target device 158. The target device system 152 may include the single target device 158, or may include several target devices in varied configurations such as (for example) master and slave configuration, gateway and edge configuration, mesh network, among several others as is generally known in the art. The system further includes a user device 120, a development environment (DE) server 140, a coding and virtualization server (CVS) 170, and a remote service 198 hosted by remote devices, each interconnected via a network 110.

The target device 158 comprises a CPU 160, support circuits 162 and a memory 164. The CPU 160 may be any commercially available processor, microprocessor, microcontroller, controllers including programmable sub-systems such as ARDUINO, TEXAS INSTRUMENTS LAUNCHPAD, FREESCALE BOARDS KINETIS, ST MICROELECTRONICS STM32, INTEL, AMD, and the like. The controllers may also be a System on a Chip (SoC) such as a RASPBERRY PI and the like. Some embodiments of controllers include programmed controllers of other assembled devices and systems such as NEST THERMOSTAT, PHILIPPS HUE, BELKIN, WITHINGS, and the like. The support circuits 162 comprise well-known circuits that provide functionality to the CPU such as a user interface, clock circuits, network communications, cache, power supplies, I/O circuits, and the like. In some embodiments, the user interface comprises a keypad, electronic buttons, speaker, touchscreen, display, camera, microphone, or other user interaction mechanisms. The memory 164 may be any form of digital storage used for storing data and executable software. Such memory includes, but is not limited to, random access memory, read only memory, disk storage, optical storage, and the like. The memory 164 stores computer readable instructions corresponding to an operating system (not shown), and an automatically generated program (AGP) 166 or a program AGP 166 comprising an automatically generated code snippet injected therein, optionally, a call 168, for example, a call to a function to be executed on a remote device such as the CVS 170 or a device for performing the remote service 198, and other code components 169, including program libraries, software development kit (SDK), necessary for executing the code including the AGP 166 and the call 168 included in the AGP 166. According to some embodiments, the AGP 166 is received from the CVS 170, or from the user device 120 or from the DE server 140, and installed in the memory 164.

The user device 120 comprises a CPU 122, support circuits 124 and a memory 126. The CPU 122 may be any commercially available processor, microprocessor, microcontroller, and the like. The support circuits 124 comprise well-known circuits that provide functionality to the CPU such as a user interface, clock circuits, network communications, cache, power supplies, I/O circuits, and the like. In some embodiments, the user interface comprises a keypad, electronic buttons, speaker, touchscreen, display, camera, microphone or other user interaction mechanisms. The memory 126 may be any form of digital storage used for storing data and executable software. Such memory includes, but is not limited to, random access memory, read only memory, disk storage, optical storage, and the like. The memory 126 stores computer readable instructions corresponding to an operating system (not shown), and a development environment (DE) 128, for example, for being used to generate a program for target devices, for example, the target device 158. The DE 128 provides a user interface to a user to create a program, for example, a program for execution on the target device 158. In some embodiments, the DE 128 is a standalone DE, installed on the user device 120. In some embodiments, the DE 128 is made available on the user device 120 via a DE server, accessible through the network 110, for example, a cloud DE server, or a DE server local to the user device 128, or a DE server otherwise communicably coupled to the user device 120. The DE 128 may also include a process library 130 and an automatic code generation user interface (ACGUI) 132 for receiving inputs from the user for automatically generating code to include in the program for the target device 158. In some embodiments, the process library 130 comprises code libraries, in different programming languages, corresponding to one or more functionalities made available for automatic code generation. In some embodiments, the process library 130 comprises an index of functionalities made available for automatic code generation. In some embodiments, the process library 130 comprises routines for optimal execution of the desired functionality according to one or more platforms, for example, routines for power management, network connectivity, errors management, sanity checks and the like. In some embodiments, the process library 128 may be updated by accessing a corresponding process library at a remote location, for example, to update the code libraries, or to include additional code corresponding to additional functionalities. In some embodiments, the DE 128 includes a code and SDK generator 134 for automatically generating code based on the inputs received via the ACGUI 132, using the process library 130. The DE 128 also includes a code injector 135 for injecting or incorporating code generated by the code and SDK generator 134 into the DE 128, and more specifically in context of a program being developed by a user (or developer) composing the program using the DE 128 on the user device 120. In some embodiments, the code injector 135 receives a selection of a location within the DE 128 (for example, via the ACGUI 132) or a location within the program, at which the automatically generated code needs to be injected to or incorporated at.

The DE server 140 comprises a CPU 142, support circuits 144 and a memory 146. The CPU 142 may be any commercially available processor, microprocessor, microcontroller, and the like. The support circuits 144 comprise well-known circuits that provide functionality to the CPU such as a user interface, clock circuits, network communications, cache, power supplies, I/O circuits, and the like. In some embodiments, the user interface comprises a keypad, electronic buttons, speaker, touchscreen, display, camera, microphone, or other user interaction mechanisms. The memory 146 may be any form of digital storage used for storing data and executable software. Such memory includes, but is not limited to, random access memory, read only memory, disk storage, optical storage, and the like. The memory 146 stores computer readable instructions corresponding to an operating system (not shown), and a development environment (DE) module 148, for providing a development environment to a user device, for example, the user device 120. The DE server 140 may be local or remote to the user device 120, or be configured as a cloud based DE server 140. The memory 146 also comprises a process library 149. In some embodiments, the process library 149 is made available as the process library 130 to the DE 128 of the user device 120. In some embodiments, the process library 149 comprises code libraries, in different programming languages, corresponding to desired functionalities, while the process library 128 comprises an index of such functionalities linked to the corresponding code in the process library 149. In some embodiments, the process library 149 comprises an index of functionalities made available for automatic code generation. In some embodiments, the process library 149 comprises routines for optimal execution of the desired functionality according to one or more platforms, for example, routines for power management, network connectivity, errors management, sanity checks and the like. In some embodiments, the process library 149 may be updated by accessing a corresponding process library at a remote location, for example, to update the code libraries, or to include additional code corresponding to additional functionalities. In some embodiments, the DE module 148 includes a code and SDK generator 150 for automatically generating code based on the inputs received via the ACGUI 132, using the process library 149. The memory 146 also includes a code injector 151 for injecting or incorporating code generated by the code and SDK generator 150 into the DE 128 (via the DE module 148), and more specifically in context of a program being developed by a user (or developer) using the DE 128 or a DE rendered using the DE module 148. In some embodiments, the code injector 151 receives a selection of a location within the DE 128 (for example, via the ACGUI 132) or the location within the program at which the automatically generated code needs to be injected to or incorporated at. In some embodiments, the DE server 140 is optional, and the DE 128 on the user device is sufficient in providing any required functionality of a development environment.

The CVS 170 comprises a CPU 172, support circuits 174, and memory 176 containing instructions and algorithms. The CPU 172 processes inputs and outputs to/from the devices. The CPU 172 may be any commercially available processor, microprocessor, microcontroller, and the like. The support circuits 174 comprise well-known circuits that provide functionality to the CPU such as a user interface, clock circuits, network communications, cache, power supplies, I/O circuits, and the like. Alternative embodiments may use control algorithms on a custom Application Specific Integrated Circuit (ASIC). In some embodiments, the user interface comprises a keypad, electronic buttons, speaker, touchscreen, display, camera, microphone, or other user interaction mechanisms. The memory 176 may be any form of digital storage used for storing data and executable software. Such memory includes, but is not limited to, random access memory, read only memory, disk storage, optical storage, and the like. The memory 176 stores computer readable instructions corresponding to an operating system (not shown), an interface 176, a code and software development kit (SDK) generator 182, a code injector 184, a process library 186, parameter store 190, authentication module 192, and an execution engine 194.

In some embodiments, the interface 178 is capable of producing a GUI 180 which may contain graphical widgets representing functions and/or widgets representing sequence of executing multiple functions. The GUI 180 is sent to user device 120 in real-time, pre-loaded to the user device 120, available as an application installable on the user device 120 by a user, or otherwise made available using known techniques, for presentation as the ACGUI 132 on the user device. Using the ACGUI 132 presented on the user device 120 in the context of DE 128, or in association with the DE 128 (e.g., by alternating between the DE 128 and the ACGUI 132), the user provides inputs regarding one or more of the desired solution. The input regarding the desired solution is received as input by the code and the SDK generator 182 to generate automatically, code corresponding to the desired functionality. In addition to receiving a selection of the desired functionality, the ACGUI 132 also receives parameters and other inputs at the user device 120, and such parameters and other inputs may be stored in the parameter store 190. The automatically generated code is generated by the code and SDK generator 182 using the process library 186, which comprises code templates corresponding to desired functionalities presented as available for automatic code generation via the ACGUI 132, and the parameter store 190, or parameter data received directly via the ACGUI 132. In some embodiments, the code and SDK generator 182 automatically generates a custom SDK for supporting the execution of the automatically generated code using the process library 186 and the parameters store 190. The custom SDK is also installed along with the automatically generated code on the target device 158, for example, as components 169. The code injector 184 injects or incorporates code generated by the code and SDK generator 182 into the DE 128, and more specifically in context of a program being developed by a user (or developer) using the DE 128 or a DE rendered using the DE module 148 on the user device 120. In some embodiments, the code injector 184 receives a selection of a location within the DE 128 (for example, via the ACGUI 132) at which the automatically generated code needs to be injected to or incorporated at.

The parameters include custom inputs to configure further the desired functionality, for example, for desired inputs/outputs, specific device(s) involved, specific connectivity, among several other operational parameters. A non-exhaustive list of parameters is presented in TABLE 1:

TABLE 1 Type Parameter Example/Comments General Profile Name of a set of parameters (includes all sub-profiles) name Hardware Hardware Arduino Uno, Arduino Yun, Texas Instruments Profile type CC3200, Raspberry PI, etc. Hardware Processor AVR, ARM, PIC, etc. Profile type Hardware Network Arduino Wifi Shield, Built-in Ethernet, Ethernet Shield, Profile Hardware BLE Shield, Built-in BLE Credential Username Username for a webservice like Facebook, . . . Profile Credential Password Password for a webservice like Facebook, . . . Profile Credential API Key Developer API key given by webservices like Profile Facebook, . . . There can be several API keys Credential API Secret Developer API secret given by webservices like Profile Facebook, . . . There can be several API secrets Connection Connection Allows to select different Connection profiles Profile Profile name Connection Type Wifi, Bluetooth, Zigbee, Z-WAVE, THREAD, LORA, Profile 6LOWPAN, . . . Connection Security WPA, WEP, unsecured, . . . Profile Type Connection SSID Wifi network identifier Profile Connection Password Network password Profile Connection Transport MQTT, CoAP, HTTP/S, TCP/IP. . . Profile Protocol Connection Role Gateway or Edge Profile Setup Output Pin Indicates which Output Pin is selected on the Profile processor (multiple Output Pins can be selected) Setup Input Pin Indicates which Input Pin is selected on the processor Profile (multiple Input Pins can be selected) Setup Pin Rule Specifies what rule is applied to a given Pin (Input or Profile Output). For example: If Temperature = 19 then write High to Pin 12 Input Required Also called variable. Can be any parameter a choreo Profile Input needs to be executed. Can be multiple Input Parameter Parameters. For example, a choreo sending an email will need Input Parameters like: Email address, Subject, Body, Attachment, . . . Input Optional Optional Input parameters are used to add Parameters Profile Input that are not necessary. Multiple Optional Input Parameter Parameters are possible. For example, a choreo sending an email has optional Input Parameters like: CC, BCC or encryption type

Such parameters may be stored in the parameter store 190, and utilized along with the process library 186 to generate code automatically at the CVS 170, or at the user device 120 or the DE server 140, where the information from the parameter store 190 is exchanged with the user device 120 or the DE server 140, respectively.

In some embodiments, the process library 186 is made available as the process library 130 to the DE 128 of the user device 120. In some embodiments, the process library 186 comprises code libraries, in different programming languages, corresponding to desired functionalities, while the process library 128 comprises an index of such functionalities linked to the corresponding code in the process library 186. In some embodiments, the process library 186 comprises an index of functionalities made available via the interface 178 to the ACGUI 132. In some embodiments, the process library 186 comprises routines for optimal execution of the desired functionality according to one or platforms, for example, routines for power management, network connectivity, errors management, sanity checks and the like. In some embodiments, the process library 186 may be used to update corresponding process library(ies) at a remote location(s), for example, to update the code libraries, or to include additional code corresponding to additional functionalities at the process library 130 or the process library 149.

In some embodiments, the ACGUI 132 also includes additional routines to allow for testing the automatically generated code or the entire program comprising the automatically generated code and various routines associated with the code. Such additional routines may include modules, for example, for simulating target devices, and executing the automatically generated code on the simulated target devices. The additional routines may also include modules for displaying the results of the aforesaid testing. The testing may be initiated upon receiving such instructions via the ACGUI. The results of the testing are displayed, for example, on the user device in the ACGUI. The testing results may be displayed live, that is, when the testing is being conducted, displaying outcomes of the testing as the outcomes occur. In some embodiments, the ACGUI 132 is used by the user to modify or reprogram the automatically generated code. In some embodiments, the ACGUI 132 is configured to track the automatically generated code, its performance, any runtime errors, modifications made, and thereby manage such automatically generated code.

In some embodiments, the access to the user device 120 and/or the DE server 140 is enabled by an authentication module 192, which comprises preconfigured credentials allowing the CVS 170 to exchange data with the user device 120 and/or the DE server 140, and particularly with the DE 128.

In some embodiments, the automatically generated code, for example, generated at the CVS 170, the user device 120, or the DE server 140 according to the techniques described herein, comprises a call to the CVS 170 from the target device 158 to execute a CVS program (CVSP) 188 at the CVS 170. The process library 188 also includes one or more such CVSPs.

The execution engine 194 supports all the foregoing functions of the CVS, including rendering the GUI 180 to the user device 120 as the ACGUI 132 (if the GUI 180 is sent to the user device 120 in real-time), executing CVSP 188, exchanging data with a remote service 198, among several others.

The remote service 198 is a service provided by a service provider device remote to the target device 158. For example, remote services include services provided by AMAZON, EBAY, FACEBOOK, APPLE PUSH NOTIFICATION, text message servers, email servers, data storage, and the like.

The network 110 comprises the Internet, or a wide area network (WAN) or a combination, and may include one or more such networks. In some embodiments, the network 110 includes one to one communication channels between any two various components of the system. For example, between the user device 120 and the DE server 140, between the user device 120 and the CVS 170, between the DE server 140 and the CVS 170, or between the target device 158 and any of the user device 120, the DE server 140 or the CVS 170.

FIG. 2 depicts a flow diagram of a method 200 executed by the system 100 for automatically generating and injecting code in development environments, in accordance with embodiments described herein. In some embodiments, the method 200 is executed when a user, creating a program in the DE 128 on the user device 120 shifts focus to ACGUI 132, which is separate from the DE 128, in order to generate code automatically, and inject the automatically generated code into a program (AGP) for the target device 158. FIGS. 3-5 are graphical user interface (GUI) screens illustrating implementation of some of the steps of the method 200, and are referred in the context of the discussion of method 200.

The method 200 begins at step 202, and proceeds to step 204, at which the user accesses an automatic code generation user interface (ACGUI). The ACGUI, for example, the ACGUI 132 is rendered by the interface 178 of the CVS 170. The method proceeds to step 206, at which the user selects a desired function and a programming language in which to generate code automatically for enabling the selected functionality. The function is selected from multiple available functions for which code can be generated automatically. In some embodiments, the programming language is auto-detected or made available by the DE. The method 200 proceeds to step 208, at which the user specifies at least one parameter for the functionality, including operational routines as discussed above. The user may additionally select routines from a library of such routines, for example, incorporated in the process library, as discussed above, and presented via the ACGUI 132, for the desired functionality at step 208.

The method 200 proceeds to step 210, at which the method 200 generates code automatically for the desired functionality. For example, the code and SDK generator automatically generate code and supporting components (e.g. SDK) for the automatically generated code, using the code templates and routine definitions stored in the process library, the parameters received via the ACGUI or the parameter store 190. According to some embodiments, the automatically generated code comprises a call from the target device to a remote device to initiate a program or service on the remote device. The call is executed when the automatically generated code, as a program or a part of a program, is executed on the target device. For example, upon execution of the program on the target device, the call is placed from the target device to the CVS, to initiate a CVSP for execution on the CVS. The call includes the at least one parameter, for example, usable for executing the CVSP. Automatically generated code is also illustrated in the GUI screen 300 of FIG. 3, box 302. Further, menu 304 illustrates a list of functionalities for which automatic generation of code is available, each of such functionalities also referred to as choreographies or “choreos.”

The method 200 proceeds to step 212, at which the user manipulates the ACGUI 132 to send the automatically generated code to the DE 128 to be injected in the complete program developed using the DE 128. In the illustrations of FIGS. 3-5, the DE 128 is a cloud IDE. For example, the user selects the instruction link 306 “Send to cloud IDE,” in the ACGUI 132 to send the automatically generated code to a user defined location in the DE 128 or within the program being composed in the DE 128. In some embodiments, the user inputs a desired location to send the automatically generated code. For example, the desired location may be within the context of an existing program being composed in the development environment or a file containing a program, thereby enabling the user to incorporate, integrate or inject the automatically generate code into the program code developed by the user, using the DE 128. For example, FIG. 4 illustrates box 308 in which the user inputs a location in a cloud IDE, for sending the automatically generated code, for example, as captured in the box 302 of FIG. 3. In the illustration of FIG. 4, the user generates a new location “IoT Application” in the cloud IDE. Accordingly, at step 212, the method 200 sends the automatically generated code to the selected location, for example, a folder in the IDE. FIG. 5 illustrates a GUI screen 500 of the cloud IDE, in which the automatically generated code of box 302 shown in FIG. 3 has been received at a corresponding location 502 “IoT Application” in the cloud IDE. The method 200 proceeds to step 214, at which the automatically generated code is injected in the program being created using the DE 128. For example, the user may inject the automatically generated code received from the ACGUI 132 to the DE 128 into a program the user is developing using the DE 128, to generate a completed program at the DE 128. In some embodiments, the automatically generated code is injected into the program based on pre-defined instructions, for example by a code injector, such as the code injector 135. The code injector 135 comprises instructions to inject the code generated automatically by the code and SDK generator, into a program being developed in the DE. In some embodiments, the code injector may be a part of the code generator on any of the user device 120, the DE server 140 or the CVS 170. The completed program comprising the automatically generated code injected therein is referred to as automatically generated program (AGP). Further, in some embodiments, the automatically generated code (or AGP) is configured to place a call to a program (CVSP) on the CVS, upon being executed on the target device 158.

The method 200 proceeds to step 216, at which the method 200 sends the AGP to the target device 158. The method 200 then ends at step 218.

FIG. 6 is a flow diagram of a method 600 for automatically generating and injecting code in development environments as executed by the system of FIG. 1, in accordance with an embodiment. In some embodiments, the method 600 is executed when a user, creating a program in the DE 128 accesses the ACGUI 132 within the context of the DE 128, for example, via a context menu in the DE 128. In such embodiments, the user does not need to exit the DE 128, and can inject automatically generated code for the desired functionality in a program being generated on the DE 128, directly from within the DE 128. FIGS. 7-12 are exemplary graphical user interface (GUI) screens illustrating implementation of some of the steps of the method 600, and are referred in the context of the discussion of method 600.

The method 600 begins at step 602, and proceeds to step 604, at which the user, in the DE 128, invokes the ACGUI 132, for example, by activating a context menu within the DE 128. For example, the GUI screen 700 of FIG. 7 shows a first ACGUI screen 702 opened in the context of a program, in a programming tab 704 titled “Untitled-2.” Another technique to access an ACGUI screen would be to expand a placeholder 706 for ACGUI, to display a menu 708 of the available functionalities. The method 600 proceeds to step 606, at which the user selects a desired function, for example, the menu 708, or specifying directly, for example, within the context of the program 704. The function is selected for multiple available functions for which code can be generated automatically. The method 600 may also receive a selection of a programming language in which to generate code automatically for enabling the selected functionality. In some embodiments, the programming language is auto-detected or made available by the DE. The method 600 proceeds to step 608, at which the user specifies at least one parameter for the functionality, including operational routines as discussed above. For example, the parameters may be entered in the several data entry boxes in the “INPUT” field 710 of the ACGUI screen 702. The user may additionally select routines from a library of such routines, for example, incorporated in the process library, as discussed above, and presented via the ACGUI 132, for the desired functionality at step 608.

The method 600 proceeds to step 610, at which at which the method 600 generates code automatically for the desired functionality. For example, the code and SDK generator automatically generate code and supporting components (e.g. SDK) for the automatically generated code, using the code templates and routine definitions stored in the process library, the parameters received via the ACGUI or the parameter store 190. According to some embodiments, the automatically generated code comprises a call from the target device to a remote device to initiate a program or service on the remote device. The call is executed when the automatically generated code, as a program or a part of a program, is executed on the target device. For example, upon execution of the program on the target device, the call is placed from the target device to the CVS, to initiate a CVSP for execution on the CVS. The call includes the at least one parameter, for example, usable for executing the CVSP. Automatically generated code is then automatically populated within the DE 128, for example, as illustrated in the GUI screen 800 of FIG. 8, ACGUI box 802, which further allows editing of the automatically generated code by the user, if so desired.

The method 600 then proceeds to step 612, at which the automatically generated code is injected in the program generated using the DE 128, for example by a code injector, such as one of the code injectors 135, 151 or 184. The code injector comprises instructions to inject the code generated automatically by the code and SDK generator, into a program being developed in the DE. In some embodiments, the code injector may be a part of the code generator on any of the user device 120, the DE server 140 or the CVS 170. For example, FIG. 9 illustrates a GUI screen 900 showing the programming tab 902 including the automatically generated code, according to various embodiments. In some embodiments, for example, FIG. 10, the GUI screen 1000 illustrates that a ACGUI 1004 is invoked from the programming tab 1002, to edit the automatically generated program injected in the program generated using the DE 128.

The ability to generate code automatically, while staying within the context of a DE has several applications in addition to those described above. For example, FIG. 11 illustrates a graphical design tool DE 1100, in which a programmable electronic device (PED) 1102, for example, field programming gate arrays (FPGAs), devices comprising a digital controller, MCUs, CPUs, Sensors, Actuators, Inducers, SoCs, among other programmable devices, is being designed. To generate code automatically for a component while designing the PED 1102, for example, for adding a functionality to pin 6 indicated by numeral 1104, the user activates context menu to display ACGUI screen 1106. As shown in FIG. 12, using a screen of ACGUI 1108, the user may select desired functionality (e.g. “Nexmo,” a service provided by VONAGE, located in New Jersey), programming language (not shown), specify configuration of the pin 6 1104 of the PED 1102 (the target device), thereby providing the information needed for the automatic generation of code to the code and SDK generators via the ACGUI. In this manner, code is generated automatically for desired functionalities and injected within a program being generated in the DE, for example DE 128. The automatically generated code comprises a call to perform the Nexmo functionality selected above, and the call includes information for performing the service, for example, one or more parameter(s) usable for performing the Nexmo service.

The method 600 proceeds to step 614 at which the method 600 sends the AGP to the target device 158. The method 600 then ends at step 616.

In some embodiments, the user has an option to edit the automatically generated code, one or more parameters, or change the function for which the automatically generated code is generated. For example, the user can select the automatically generated code using the ACGUI, and edit the automatically generated code, or the parameters. In some embodiments, the user can select a different function from the multiple available functions, and generate code automatically for this different function, which is then inserted in the program for the target device, for example, using one or more steps of the methods 200 or 600.

As another example, FIG. 13 shows a screen of an ACGUI 1300 for receiving inputs, including parameters, for generating a simple code for posting a message on TWITTER. The ACGUI 1300 may be accessed alongside a development environment for Java such as ECLIPSE.ORG (method 200), or in the context of ECLIPSE.ORG (method 600). The code is generated automatically, for example, by any of the code and SDK generators (134, 150, 182), as follows:

TembooSession session = new TembooSession(“demo”, “myFirstApp”, “7d7567f-e76147c7-8”); SendDirectMessage sendDirectMessageChoreo = new SendDirectMessage(session); // Get an InputSet object for the choreo SendDirectMessageInputSet sendDirectMessageInputs = sendDirectMessageChoreo.newInputSet( ); // Set credential to use for execution sendDirectMessageInputs.setCredential(“TwitterCredentials”); // Set inputs sendDirectMessageInputs.set_ScreenName(“@testuser”); sendDirectMessageInputs.set_Text(“Hello!!!!”); // Execute Choreo SendDirectMessageResultSet sendDirectMessageResults = sendDirectMessageChoreo.execute(sendDirectMessageInputs);

The automatically generated code is injected by a code injector (135, 151, 184) into an app or a program being developed in ECLIPSE.ORG using Java, for example, based on user instructions, or automatically, according to the methods 200 or 600.

FIG. 14 is a flow diagram of a method 1400 illustrating execution of an automatically generated program (AGP) executed by the system of FIG. 1, already sent to the target device, in accordance with an embodiment. The method 1400 begins at step 1402 and proceeds to step 1404 at which the method 1400 installs the program (AGP) developed on the IDE (of the user device), comprising the automatically generated code according to the embodiments described herein, on the target device 158. The method 1400 proceeds to step 1406, at which the method 1400 begins executing the AGP, and at step 1408, the method 1400 places a call to a remote device, for example, from the target device 150 to the CVS 170 for executing a process CVSP on the CVS 170, or from the target device 150 to the remote service 198 directly. In some embodiments, execution of the CVSP or the remote service further exchanges data with the remote service 198. In some embodiments, the CVSP returns data (from execution of the CVSP or the remote service 198) to the AGP. The method 1400 proceeds to step 1410, at which the method 1400 continues execution of the AGP. In some embodiments, the method 1400 waits for receipt of data or instruction from the CVS 170 or the remote service 198 to the target device 158, while in some embodiments, the method 1400 continues execution of the AGP without waiting for any data from the CVS 170 or the remote service 198. The method 1400 proceeds to step 1412, at which the method 1400 ends.

The ACGUI may take various forms to provide tools for receiving inputs for designing, testing, monitoring, and modifying controller based solutions for application systems. The ACGUI may include selectable text, form fields, icons representing elements or parameters of the solution, widgets representing functions and the sequence of execution thereof, graphs and tables to display a state of the solution, among several other elements used in GUIs for the purpose of receiving inputs and presenting information or outputs. As would occur readily to those of ordinary skill, several such variations of the GUIs may be used in order to practice the embodiments described, without departing from the scope and spirit of the embodiments described herein. While the embodiments are described with respect to Internet of things (IoT) devices, those skilled in the art will readily appreciate that the techniques exemplified by the disclosed embodiments are applicable to several other programming environments and devices, including mobile, desktop, server, web-based applications.

The embodiments directed herein may be directed to any programming languages or frameworks, including, but not limited to JAVA, C, C #, IOS, PHP, ANDROID, JAVASCRIPT, NODE.JS, RUBY, PYTHON, among several others. The target device could be any processor based device, and the automatically generated code could be used could be used as, or when generating code for insertion into, applications for IoT, mobile, web, desktop, and server devices. While reference to IoT devices, programs and parameters is made as an example, the embodiments described herein are not limited to such examples. Those of ordinary skill would appreciate that the embodiments described herein are applicable to programming for various other processor based devices equally well, which are within the scope and spirit of the present invention. For example, embodiments described herein are usable to build a desktop application, and in some embodiments, the desktop application so generated may be installed on user device, that is, in such a scenario, the user device and target device would be the same. In some embodiments, the embodiments described herein are usable to build a web application installed on a web server, which is the target device in this example.

The methods described herein may be implemented in software, hardware, or a combination thereof, in different embodiments. The methods may be incorporated in processor executable instructions stored on non-transitory computer readable media. In addition, the order of methods may be changed, and various elements may be added, reordered, combined, omitted or otherwise modified. All examples described herein are presented in a non-limiting manner. Various modifications and changes may be made as would be obvious to a person skilled in the art having benefit of this disclosure. Realizations in accordance with embodiments have been described in the context of particular embodiments. These embodiments are meant to be illustrative and not limiting. Many variations, modifications, additions, and improvements are possible. Accordingly, plural instances may be provided for components described herein as a single instance. Boundaries between various components, operations and data stores are somewhat arbitrary, and particular operations are illustrated in the context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within the scope of claims that follow. Finally, structures and functionality presented as discrete components in the example configurations may be implemented as a combined structure or component. These and other variations, modifications, additions, and improvements may fall within the scope of embodiments as defined in the claims that follow.

While the foregoing is directed to embodiments described herein, other and further embodiments may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow. 

1. A computer-implemented method for automatically generating and incorporating code in a development environment (DE), the method comprising: while a program for a target device is being composed using the DE on a user device, displaying an automatic code generation user interface (ACGUI) on the user device, separate from the DE or in a context of the DE; receiving, via the ACGUI, a selection of a function from a plurality of available functions for generating code automatically corresponding to the selected function; receiving at least one parameter for executing the automatically generated code to perform the function; automatically generating the code in the ACGUI based on the selected function and the at least one parameter, the automatically generated code configured to perform the function upon execution of the automatically generated code; incorporating the automatically generated code in the program for the target device; and sending the program to the target device for installation and execution on the target device, wherein the user device is remote to the target device.
 2. The method of claim 1, wherein the automatically generated code comprises a call from the target device to a code virtualization server (CVS) for executing a CVS program (CVSP) on the CVS to perform the function, the call comprising the at least one parameter, wherein the CVSP is executed on the CVS using the at least one parameter, wherein the CVS is remote to the user device and the target device, and wherein the at least one parameter is received via the ACGUI, or via a file stored on at least one of the user device or the CVS.
 3. The method of claim 2, further comprising: receiving, at the CVS from the target device, the call for executing the CVSP, the call comprising the at least one parameter for executing the CVSP; executing the CVSP on the CVS using the at least one parameter; and optionally returning data, from the execution of the CVSP, from the CVS to the target device.
 4. The method of claim 1, wherein the automatically generated code comprises a call from the target device to a remote service provided by a device remote to the user device and the target device, the remote service configured to perform the function, the call comprising the at least one parameter, wherein the remote service is executed using the at least one parameter.
 5. The method of claim 4, further comprising: receiving, at the remote device from the target device, the call for executing the remote service, the call comprising the at least one parameter for executing the remote service, executing the remote service using the at least one parameter, and optionally returning data, from the execution of the remote service, from the remote device to the target device.
 6. The method of claim 1, further comprising: receiving, via the ACGUI, a selection of a location in the program to insert the automatically generated code, wherein the incorporating the automatically generated code in the program is based on the received selection of the location.
 7. The method of claim 1, further comprising: after the incorporating the automatically generated code in the program, receiving, in the ACGUI, an instruction to edit the automatically generated code; displaying, in the ACGUI, at least one of an option to edit the automatically generate code, or an option to edit the at least one parameter; receiving instructions to edit at least one of the automatically generated code, or the at least one parameter; modifying the automatically generated code based on the received instructions to edit the at least one of the automatically generated code, or the at least one parameter to yield an automatically generated modified code; incorporating the automatically generated modified code in the program for the target device; and sending the program to the target device for installation and execution on the target device.
 8. The method of claim 1, further comprising: after the incorporating the automatically generated code in the program, receiving, in the ACGUI, an instruction to change the selected function and the automatically generated code corresponding thereto; displaying, in the ACGUI, the plurality of available functions for automatic code generation; receiving, via the ACGUI, a selection of a second function from the plurality of available functions for generating a second code automatically corresponding to the second function; receiving at least one parameter for executing the automatically generated second code to perform the second function; automatically generating the second code in the ACGUI based on the selected second function and the at least one parameter for executing the automatically generated second code, the automatically generated second code configured to perform the second function upon execution of the automatically generated second code; incorporating the automatically generated second code in the program for the target device; and sending the program to the target device for installation and execution on the target device.
 9. The method of claim 1, further comprising receiving, on the ACGUI on the user device, instructions to initiate testing of the automatically generated code; initiating testing of the automatically generated code; and displaying results of the testing on the user device in the ACGUI.
 10. A system for automatically generating and incorporating code in a development environment, the system comprising a user device, a target device and a code virtualization server (CVS), each remote to the other and communicably coupled via a network, the user device comprising at least one processor, and a memory comprising executable instructions, which when executed using the at least one processor executes a method comprising: while a program for a target device is being composed using a development environment (DE) on a user device, displaying an automatic code generation user interface (ACGUI) on the user device, separate from the DE or in a context of the DE, receiving, via the ACGUI, a selection of a function from a plurality of available functions for generating code automatically corresponding to the selected function, receiving at least one parameter for executing the automatically generated code to perform the function, automatically generating the code in the ACGUI based on the selected function and the at least one parameter, the automatically generated code configured to perform the function upon execution of the automatically generated code, incorporating the automatically generated code in the program for the target device, and sending the program to the target device for installation and execution on the target device.
 11. The system of claim 10, wherein the automatically generated code comprises a call from the target device to a code virtualization server (CVS) for executing a CVS program (CVSP) on the CVS to perform the function, the call comprising the at least one parameter, wherein the CVSP is executed on the CVS using the at least one parameter, wherein the CVS is remote to the user device and the target device, and wherein the at least one parameter can be received via the ACGUI or a file stored on at least one of the user device, or the CVS.
 12. The system of claim 11, wherein the CVS comprises at least one processor and a memory comprising the CVSP, which is configured to perform a method comprising: receiving, at the CVS from the target device, the call for executing the CVSP, the call comprising the at least one parameter for executing the CVSP, executing the CVSP on the CVS using the at least one parameter, and optionally returning data, from the execution of the CVSP, from the CVS to the target device.
 13. The system of claim 10, wherein the automatically generated code comprises a call from the target device to a remote service provided by a device remote to the user device and the target device, the remote service configured to perform the function, the call comprising the at least one parameter, wherein the remote service is executed using the at least one parameter.
 14. The system of claim 13, wherein the remote device providing the remote service is configured to perform a method comprising: receiving, at the remote device from the target device the call for executing the remote service, the call comprising the at least one parameter for executing the remote service, executing the remote service using the at least one parameter, and optionally returning data, from the execution of the remote service, from the remote device to the target device.
 15. The system of claim 10, further comprising: receiving, via the ACGUI, a selection of a location in the program to insert the automatically generated code, wherein the incorporating the automatically generated code in the program is based on the received selection of the location.
 16. The system of claim 10, further comprising: after the incorporating the automatically generated code in the program, receiving, in the ACGUI, an instruction to edit the automatically generated code; displaying, in the ACGUI, at least one of an option to edit the automatically generate code, or an option to edit the at least one parameter; receiving instructions to edit at least one of the automatically generated code, or the at least one parameter; modifying the automatically generated code based on the received instructions to edit the at least one of the automatically generated code, or the at least one parameter to yield an automatically generated modified code; incorporating the automatically generated modified code in the program for the target device; and sending the program to the target device for installation and execution on the target device.
 17. The system of claim 10, further comprising: after the incorporating the automatically generated code in the program, receiving, in the ACGUI, an instruction to change the selected function and the automatically generated code corresponding thereto; displaying, in the ACGUI, the plurality of available functions for automatic code generation; receiving, via the ACGUI, a selection of a second function from the plurality of available functions for generating a second code automatically corresponding to the second function; receiving at least one parameter for executing the automatically generated second code to perform the second function; automatically generating the second code in the ACGUI based on the selected second function and the at least one parameter for executing the automatically generated second code, the automatically generated second code configured to perform the second function upon execution of the automatically generated second code; incorporating the automatically generated second code in the program for the target device; and sending the program to the target device for installation and execution on the target device.
 18. The system of claim 10, further comprising receiving, on the ACGUI on the user device, instructions to initiate testing of the automatically generated code; initiating test of the automatically generated code; and displaying results of the testing on the user device in the ACGUI.
 19. A non-transitory computer readable medium comprising processor executable instructions to execute a method for automatically generating and incorporating code in a development environment (DE), the method comprising: while a program for a target device is being composed using the DE on a user device, displaying an automatic code generation user interface (ACGUI) on the user device, separate from the DE or in a context of the DE; receiving, via the ACGUI, a selection of a function from a plurality of available functions for generating code automatically corresponding to the selected function; receiving at least one parameter for executing the automatically generated code to perform the function; automatically generating the code in the ACGUI based on the selected function and the at least one parameter, the automatically generated code configured to perform the function upon execution of the automatically generated code; incorporating the automatically generated code in the program for the target device; and sending the program to the target device for installation and execution on the target device, wherein the user device is remote to the target device.
 20. The non-transitory computer readable medium of claim 19, wherein the automatically generated code comprises either a call from the target device to a code virtualization server (CVS) for executing a CVS program (CVSP) on the CVS to perform the function, the call comprising the at least one parameter, wherein the CVSP is executed on the CVS using the at least one parameter, wherein the CVS is remote to the user device and the target device, and wherein the at least one parameter is received via the ACGUI, or via a file stored on at least one of the user device or the CVS. 